package model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import session.GeneralSession;


public class GeneralModel {
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarTipoCanal(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryTipoCanal();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarTipoDirec(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryTipoDirec();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarTipoPers(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryTipoPers();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarEstadoSol(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryEstadoSol();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarTipoDocu(int flg){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryTipoDocu(flg);
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarTipoSolic(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryTipoSolic();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_TIP_SOL").toString(),map.get("xCOD_TIP_SOL").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarBieServicio(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryBieServicio();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarDepa(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryDepa();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xDSC_UBI_GEO").toString(),map.get("xCOD_DEP").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarPrvi(int codigoDep){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryPrvi(codigoDep);
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xDSC_UBI_GEO").toString(),map.get("xCOD_PRVI").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarDist(int codigoDep,int codigoPrvi){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryDist(codigoDep,codigoPrvi);
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xDSC_UBI_GEO").toString(),map.get("xCOD_DIST").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarTipoEntidad(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryTipoEntidad();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_TIP_ENT").toString(),map.get("xCOD_ENT").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarVia(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryVia();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_LAR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,String> listarCodigoIntDir(){
		Map<String,String> mapa = new HashMap();
		GeneralSession generalSession = new GeneralSession();
		ArrayList<Object> lista = (ArrayList<Object>)generalSession.queryCodigoIntdir();
		for (Object object : lista) {
			Map map = (Map) object;
			mapa.put(map.get("xNOM_PAR_COR").toString(),map.get("xCOD_PAR").toString());
		}

		return mapa;
	}
	
}
